<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script>
	//1. location
	function f1() {
		var b = confirm("您确定要离开本页面吗？");
		if(b) {
			location.href = "http://www.tmooc.cn";
		}
	}
	function f2() {
		location.reload();
	}
	//2. history
	function f3() {
		history.forward();
	}
	//3. screen
	function f4() {
		console.log(screen.width);
		console.log(screen.height);
		console.log(screen.availWidth);
		console.log(screen.availHeight);
	}
	//4. navigator
	function f5() {
		console.log(navigator.userAgent);
	}
</script>
</head>
<body>
	<input type="button" value="达内"
		onclick="f1();"/>
	<input type="button" value="刷新"
		onclick="f2();"/>
	<input type="button" value="前进"
		onclick="f3();"/>
	<input type="button" value="屏幕"
		onclick="f4();"/>
	<input type="button" value="基础"
		onclick="f5();"/>
</body>
</html>








